package com.it.jnxy.Controller;

import com.it.jnxy.Pojo.Result;
import com.it.jnxy.Pojo.User2;
import com.it.jnxy.Service.RegisterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;


@RestController
public class RegisterController {
    @Autowired
    RegisterService registerService;
    //注册功能
    @PostMapping("/register")
    public Result register(@RequestBody User2 ruser){
        Integer reg = registerService.Register(ruser);
        if (reg == 0){
           return Result.error("用户已存在");
        }
        return Result.sucess();

    }
}
